import React, { useContext, useState } from 'react'
import StartNode from '@/Model/Node/StartNode'

import {ChapterContext} from '@/hooks/useChapterContext'
import TextField from '@mui/material/TextField'
import NodeCard from './NodeCard'
import useEditor from '../hooks/useEditor'

interface Props{
  data: StartNode
}

export default function StartCard (props: Props) {
  const {handleOnChangeTitle, handleOnChangeDesc, reRender} = useEditor(props.data.uuid) 
 
  return <NodeCard data={props.data} type="开始">
    <TextField variant="standard" onInput={handleOnChangeTitle} label="标题:" value={props.data.title} style={{width: '100%'}} />
    <TextField
      onInput={handleOnChangeDesc}
      multiline
      variant="standard"
      label="描述:"
      value={props.data.desc}
      style={{width: '100%'}}  />
  </NodeCard>
}
